//
// ---> Game Specific Objects
//
// -- CPP ---- Game Camera Class

#include "GameCamera.h"
#include "Error.h"
#include "Game.h"
#include "Timer.h"
#include <iostream>

GameCamera::GameCamera()
{
}

GameCamera::~GameCamera()
{
}

void GameCamera::Update()
{
	float dt = Engine::TheTimer::Instance()->GetDT();

	Engine::Vec3 old_vel = m_vel;
	m_pos += (m_vel + old_vel) * 0.5f * dt;
	m_foc += (m_vel + old_vel) * 0.5f * dt;

	m_camera.SetPerspective(45.0f, 1.5f, 1.0f, 1000.0f);
	m_camera.SetLookAt(m_pos, Engine::Vec3(0.0f, 1.0f, 0.0f), m_foc);
}

void GameCamera::Draw()
{
	m_camera.Perspective();
	m_camera.LookAt();
}